Skip to content

REF: Parametrize value_counts tests #28537

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 20, 2019
Merged

REF: Parametrize value_counts tests #28537

merged 2 commits into from
Sep 20, 2019

Conversation

dsaxton
Copy link
Member

@dsaxton dsaxton commented Sep 19, 2019

Parametrizes the for loop in test_series_groupby_value_counts. As a side note, this test seems to run for a pretty long time (a minute and a half); should it operate on less data perhaps?

@TomAugspurger
Copy link
Contributor

TomAugspurger commented Sep 19, 2019 via email

@WillAyd
Copy link
Member

WillAyd commented Sep 20, 2019

Yea a minute and a half for one test is too much. Is there a way to get it down to a few seconds and still get the same measurement?

@WillAyd WillAyd added the Benchmark Performance (ASV) benchmarks label Sep 20, 2019
@WillAyd WillAyd added this to the 1.0 milestone Sep 20, 2019
@WillAyd WillAyd added Testing pandas testing functions or related to the test suite and removed Benchmark Performance (ASV) benchmarks labels Sep 20, 2019
@@ -52,29 +52,28 @@ def seed_df(seed_nans, n, m):

@pytest.mark.slow
@pytest.mark.parametrize("df, keys, bins, n, m", binned, ids=ids)
def test_series_groupby_value_counts(df, keys, bins, n, m):
@pytest.mark.parametrize(
"isort, normalize, sort, ascending, dropna", list(product((False, True), repeat=5))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really a fan of using itertools to generate parametrization. Could you instead write this as:

@pytest.mark.parametrize("isort", [True, False])
@pytest.mark.parametrize("normalize", [True, False])
...

Equivalent at the end of the day but I think clearer and match the rest of the codebase

@jreback
Copy link
Contributor

jreback commented Sep 20, 2019

this is a comprehensive test and is marked as slow, so perf is ok, other than @WillAyd comment lgtm.

@WillAyd WillAyd merged commit fdffc50 into pandas-dev:master Sep 20, 2019
@WillAyd
Copy link
Member

WillAyd commented Sep 20, 2019

Thanks @dsaxton

@dsaxton dsaxton deleted the param-test branch September 20, 2019 14:42
proost pushed a commit to proost/pandas that referenced this pull request Dec 19, 2019
proost pushed a commit to proost/pandas that referenced this pull request Dec 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants